A virtualization technology can be used to simulate one or more virtual machines (VM) on a host device (the host device may also be referred to as a computer device, a physical host, or a physical computer). A VM may work like a host device. For example, a user may install an operating system and an application program on the VM. For another example, a user may access a network resource by using the VM. For a user, the VM may be considered as an application program running on the host device, but for an application program running on the VM, the VM provides an operating environment for the application program just like a real host device.
A single-root input/output virtualization (SRIOV) technology allows multiple VMs to efficiently share a peripheral component interconnect express (PCIe) device. The SRIOV introduces concepts of a physical function (PF) and a virtual function (VF) to support virtualization of a network adapter (or referred to as a network interface card, a physical network card, or a physical network interface card). The PF is a PCI function supported by the network adapter and may be extended as several VFs. The VF is an instance obtained by means of virtualization by an SRIOV-supported network adapter. A bandwidth resource for data transmission is configured for each VF of the network adapter. Each VF is allocated by a virtual machine monitor (VMM) to the VM running on the host device.
Inside the network adapter, a virtual switch function is provided and a bandwidth limiting function can be provided by using the PF/VF. A user (or an administrator) can allocate bandwidth to each VF by using the bandwidth limiting function. In the prior art, one VF is corresponding to one virtual network interface card (vNIC), and therefore, the bandwidth resource allocated to each VF is exclusively used by one vNIC and cannot be shared among multiple vNICs.